/*
 * TabAddition.h
 *
 *  Created on: 9 déc. 2013
 *      Author: Raphaël
 */

#ifndef TABADDITION_H_
#define TABADDITION_H_

#include <vector>
#include <memory>
#include "raphTools/thread/Thread.h"
#include "raphTools/WorkspaceTools.h"

/**
 * @brief
 *	compute the addition between two vector with threads
 */
class AddThread: public raph::Thread
    {
    private:
        /*-------------------------------------------------------------------
         attributs
         -------------------------------------------------------------------*/
        std::vector<raph::type::T_FLOAT128> m_vecA;
        std::vector<raph::type::T_FLOAT128> m_vecB;
        std::weak_ptr<raph::type::T_FLOAT128> m_ptrTabResult;
        raph::type::T_INT64 m_N;
        raph::type::T_INT64 m_startPosition;

    public:
        /*-------------------------------------------------------------------
         constructor/destructor
         -------------------------------------------------------------------*/
        AddThread(const std::vector<raph::type::T_FLOAT128>&,
                const std::vector<raph::type::T_FLOAT128>&,
                const std::shared_ptr<raph::type::T_FLOAT128>& ptrTabResult,
                const raph::type::T_INT64& N, const raph::type::T_INT64& startPosition);
        virtual ~AddThread();
        /*-------------------------------------------------------------------
         public methods
         -------------------------------------------------------------------*/
        /**
         * @brief
         *	this method compute the addition for each thread
         */
        void run() override;

    };

#endif /* TABADDITION_H_ */
